Method and system of limiting traffic

ABSTRACT

The present disclosure provides a method and system of limiting traffic. The method includes: sending, by a distributed node, a service volume in a current preset time period to a central node according to a fixed period; determining, by the central node, a decision quota of the distributed node based on the received service volume, and sending the decision quota to the distributed node; receiving, by the distributed node, the decision quota sent by the central node; and determining, by the distributed node based on the latest received decision quota after receiving an access request, whether traffic limitation needs to be performed for the access request. The traffic limitation decision of the present application is made by the distributed node autonomously, the decision path is short, and fast and accurate decision making is achieved.

CROSS-REFERENCE TO RELATED APPLICATIONS

The present disclosure is a continuation of international applicationNo. PCT/CN2019/090339 filed on Jun. 6, 2019, and claims priority toChinese Patent Application No. 201910364818.4, filed on Apr. 30, 2019and entitled “METHOD AND SYSTEM OF LIMITING TRAFFIC ”, which areincorporated herein by reference in its entirety.

TECHNICAL FIELD

The present disclosure relates to the field of Internet traffic limitingtechnology, and in particular, to a method of limiting traffic and asystem of limiting traffic.

BACKGROUND

With the rapid development of the Internet, the scale of computersystems is become larger, and distributed systems emerge accordingly. Toensure the system stability, the overall service volume of thedistributed system is limited. Existing methods of limiting trafficinclude centralized traffic limiting and average/weight-baseddistribution. However, the two methods have their own disadvantages.

The centralized traffic limiting method is disadvantageous in that eachtraffic limiting decision of a distributed node requires interactionwith a central node, resulting in a long decision path and slow decisionmaking. Because the load of the distributed node changes all the time,and data at the time of decision implementation is different from thedata at the time of decision making and delivery to the distributednode, the central node cannot make a decision according to real-timedata, and is likely to make an incorrect decision, affecting the overallperformance of the system.

For the average/weight-based distribution method, a fixed service volumeis allocated to each distributed node. The decision making, though fast,is not accurate. Especially in the case of unbalanced load, somedistributed nodes are overloaded, but the overall service volume of thesystem does not reach an upper limit.

SUMMARY

To resolve the problem of the prior art, embodiments of the presentapplication provide a method of limiting traffic and a system oflimiting traffic. The technical solutions are as follows.

According to a first aspect, a method of limiting traffic is provided,and the method includes:

sending, by a distributed node, a service volume in a current presettime period to a central node according to a fixed period;

determining, by the central node, a decision quota of the distributednode based on the received service volume, and sending the decisionquota to the distributed node;

receiving, by the distributed node, the decision quota sent by thecentral node; and determining, by the distributed node based on thelatest received decision quota after receiving an access request,whether traffic limitation needs to be performed for the access request.

Optionally, the service volume further includes a back-to-source volume;and

correspondingly, the step of determining, by the distributed node basedon the latest received decision quota after receiving an access request,whether traffic limitation needs to be performed for the access requestincludes:

after receiving the access request, determining, by the distributednode, whether a back-to-source request needs to be sent to a sourcestation; and

if yes, determining, based on the latest received decision quota,whether traffic limitation needs to be performed for the access request.

Optionally, the service volume in the preset time period includes atleast one of traffic generated by the distributed node in the presettime period, an average bandwidth in the preset time period, the numberof connections established in the preset time period, and the number ofaccess requests in the preset time period.

Optionally, the step of determining, by the distributed node based onthe latest received decision quota, whether traffic limitation needs tobe performed for the access request includes:

comparing, by the distributed node, a current service increment with thelatest received decision quota; and

if the current service increment of the distributed node is less thanthe latest received decision quota, skipping performing trafficlimitation, or otherwise, performing traffic limitation for the accessrequest.

Optionally, after the determining, by the distributed node, that thecurrent service increment is greater than or equal to the latestreceived decision quota, the method further includes:

determining a time interval between a current time and a time at which aservice volume is sent to the central node last time;

if the time interval is less than a preset duration, performing trafficlimitation for the access request; and

if the time interval is greater than or equal to the preset duration,sending the service volume in the current preset time period to thecentral node, receiving a new decision quota sent by the central node,and then determining, based on the latest received decision quota,whether traffic limitation needs to be performed for the access request.

Optionally, the step of performing, by the distributed node, trafficlimitation for the access request includes:

rejecting, by the distributed node, the access request; or

limiting, by the distributed node, a response rate to the accessrequest.

Optionally, after the determining, by the distributed node, that thecurrent service increment is greater than or equal to the latestreceived decision quota, the method further includes:

responding, by the distributed node, to the access request at a presetresponse rate; and

receiving, by the distributed node, a next access request, and rejectingthe next access request if the current service increment is stillgreater than or equal to the latest received decision quota.

Optionally, after the responding, by the distributed node, to the accessrequest with a preset response rate, the method further includes:

receiving, by the distributed node, the next access request, and if thecurrent service increment is less than the latest received decisionquota and a current average response rate is greater than the presetresponse rate, responding to the next access request at the presetresponse rate, wherein the current average response rate is equal to aratio of traffic generated in the current preset time period to thenumber of access requests in the current preset time period; and

receiving, by the distributed node, the next access request, and if thecurrent service increment is less than the latest received decisionquota and the current average response rate is less than or equal to thepreset response rate, skipping performing traffic limitation.

According to a second aspect, a system of limiting traffic is provided,including a distributed node and a central node, wherein

the distributed node is configured to send a service volume in a currentpreset time period to the central node according to a fixed period;

the central node is configured to determine a decision quota of thedistributed node based on the received service volume, and sending thedecision quota to the distributed node; and

the distributed node is configured to receive the decision quota sent bythe central node, and after receiving an access request, determine,based on the latest received decision quota, whether traffic limitationneeds to be performed for the access request.

Optionally, the service volume further includes a back-to-source volume;and

correspondingly, the distributed node is configured to:

after receiving an access request, determine whether a back-to-sourcerequest needs to be sent to a source station; and

if yes, determine, based on the latest received decision quota, whethertraffic limitation needs to be performed for the access request.

Optionally, the service volume in the preset time period includes atleast one of traffic generated by the distributed node in the presettime period, an average bandwidth in the preset time period, the numberof connections established in the preset time period, and the number ofaccess requests in the preset time period.

Optionally, the distributed node is configured to:

compare a current service increment with the latest received decisionquota; and

if the current service increment is less than the latest receiveddecision quota, skip performing traffic limitation, or otherwise,perform traffic limitation on the access request.

Optionally, the distributed node is configured to:

determine a time interval between a current time and a time at which aservice volume is sent to the central node last time;

if the time interval is less than a preset duration, perform trafficlimitation for the access request; and

if the time interval is greater than or equal to the preset duration,send the service volume in the current preset time period to the centralnode, receive a new decision quota sent by the central node, and thendetermine, based on the latest received decision quota, whether trafficlimitation needs to be performed for the access request.

Optionally, the distributed node is configured to:

perform traffic limitation by rejecting the access request; or

perform traffic limitation by limiting a response rate to the accessrequest.

Optionally, the distributed node is configured to:

after determining that the current service increment is greater than orequal to the latest received decision quota, respond to the accessrequest with a preset response rate; and

receive a next access request, and reject the next access request if thecurrent service increment is still greater than or equal to the latestreceived decision quota.

Optionally, the distributed node is configured to:

receive the next access request after responding to the access requestat the preset response rate, and if the current service increment isless than the latest received decision quota and a current averageresponse rate is greater than the preset response rate, respond to thenext access request at the preset response rate, wherein the currentaverage response rate is equal to a ratio of traffic generated in thecurrent preset time period to the number of access requests in thecurrent preset time period; and

receive the next access request, and if the current service increment isless than the latest received decision quota and the current averageresponse rate is less than or equal to the preset response rate, skipperforming traffic limitation.

According to a third aspect, a node device is provided, including:

at least one processor; and

a memory communicably connected with the at least one processor forstoring instructions executable by the at least one processor,

wherein execution of the instructions by the at least one processorcauses the at least one processor to perform the processing processperformed by the distributed node in the method of limiting trafficaccording to the first aspect described above.

According to a fourth aspect, a computer readable storage medium isprovided, storing a computer program, wherein the computer program isexecuted by a processor to implement the processing process performed bythe distributed node in the method of limiting traffic according to thefirst aspect described above.

In the embodiments of the present application, the traffic limitationdecision is made by the distributed node autonomously, the decision pathis short, and fast decision is achieved. In addition, according to thestatistical principle, a corresponding decision quota can be allocatedeach distributed node according to the real-time service volume of eachdistributed node. That is, the larger the service volume is, the higherthe allocated decision quota is. In this way, a distributed node in aheavy-traffic area can receive and respond to access requests to thegreatest extent, thereby improving the utilization of resources.Moreover, the method of limiting traffic is more accurate and canimprove the service performance of the distributed system.

BRIEF DESCRIPTION OF THE DRAWINGS

To describe the technical solutions of the embodiments of the presentdisclosure more clearly, the accompanying drawings required forillustrating the embodiments will be introduced briefly in thefollowing. Apparently, the accompanying drawings in the followingdescription are merely some embodiments of the present disclosure, and aperson of ordinary skill in the art may obtain other accompanyingdrawings based on these accompanying drawings without creative efforts.

FIG. 1 is a schematic diagram of a network architecture according to anembodiment of the present application;

FIG. 2 is a flowchart of a method of limiting traffic according to anembodiment of the present application;

FIG. 3 is a schematic diagram of another network architecture accordingto an embodiment of the present application; and

FIG. 4 is a structural block diagram of a node device according to anembodiment of the present application.

DETAILED DESCRIPTION

To make the objectives, technical solutions and advantages of thepresent disclosure clearer, the embodiments of the present disclosureare described in detail below with reference to the accompanyingdrawings.

An embodiment of the present disclosure provides a method of limitingtraffic. The method can be applied to a network framework shown inFIG. 1. The network framework includes a central node and a plurality ofdistributed nodes, and each distributed node is connected to the centralnode. In a Content Delivery Network (CDN) system, the distributed nodeis a CDN node. The distributed node is configured to receive an accessrequest sent by a client and provide a service. In a scenario to whichtraffic limitation is applied, each distributed node first sends aservice volume in a current preset time period to the central nodeaccording to a fixed period. The central node then determines a decisionquota corresponding to each of the distributed nodes based on theservice volumes sent by all the distributed nodes, and sends thecorresponding decision quota to each of the distributed nodes. Each ofthe distributed nodes receives the decision quota, and after receivingan access request, determines, based on the latest received decisionquota, whether traffic limitation needs to be performed for the accessrequest. The traffic limitation decision is made by the distributed nodeautonomously, the decision path is short, and fast decision is achieved.In addition, according to the statistical principle, a correspondingdecision quota can be allocated according to the real-time servicevolume of each distributed node. That is, the larger the service volumeis, the higher the allocated decision quota is. In this way, adistributed node in a heavy-traffic area can receive and respond toaccess requests to the greatest extent, thereby improving theutilization of resources. Moreover, the method of limiting traffic ismore accurate and can improve the service performance of the distributedsystem.

FIG. 2 is a flowchart of a method of limiting traffic according to anembodiment of the present application. Referring to FIG. 2, the methodspecifically includes following steps.

Step 201: A distributed node sends a service volume in a current presettime period to a central node according to a fixed period.

Each distributed node in a distributed system sends a service volume ina current preset time period to a central node according to a same fixedperiod. The fixed period may be set to any length, for example, onesecond or one minute. The service volume in the current preset timeperiod may be a service volume within a period of time before thecurrent time. For example, when the current time is t and the presettime period is 1 minute, the service volume in the current preset timeperiod is a service volume during the period from t-1 to t.

In the CDN system, after a CDN node (distributed node) receives anaccess request sent by a client, if the content to be accessed is cachedin the node, the cache is directly used to respond, that is, serve theaccess request. If the content to be accessed is not cached in the CDNnode, or the cached content has expired, a back-to-source request issent to a source station to request the content. Embodiments of thepresent disclosure may perform traffic limitation for the scenario ofserving the access request, and may also perform traffic limitation forthe back-to-source scenario, that is, restricting the CDN node fromsending a back-to-source request to the source station. When trafficlimitation is performed for the scenario of serving the access request,the service volume sent by the distributed node to the central node is aservice volume generated in response to the access request. When trafficlimitation is performed for the back-to-source scenario, the servicevolume sent by the distributed node to the central node is the servicevolume generated during the back-to-source process. That is to say, theservice volume sent by the distributed node to the central node includesthe service volume generated in response to the access request, or theservice volume generated during the back-to-source process, that is, aback-to-source volume. Performing traffic limitation for theback-to-source scenario can prevent the source station from bearingexcessive access load and ensure the stability of the source station.

The service volume may be expressed by traffic, bandwidth, the number ofconnections, or the number of access requests. Specifically, when theservice volume sent by the distributed node to the central node is theservice volume generated in response to the access request, the servicevolume in the preset time period includes one or more of trafficgenerated by the distributed node in the preset time period, an averagebandwidth in the preset time period, the number of connectionsestablished in the preset time period, or the number of access requestsin the preset time period. When the service volume is represented by thenumber of connections, the service volume in the preset time period isthe number of connections established by the distributed node with theclient within the preset time period. When the service volume isrepresented by the number of access requests, the service volume in thepreset time period is the number of access requests of the distributednode in the preset time period, wherein the number of access requests inthe preset time period may be the number of access requests that havebeen responded to, or the sum of the number of access requests that havebeen responded to and the number of access requests that are currentlybeing responded to, or the sum of the number of access requests thathave been responded to, the number of access requests that are currentlybeing responded to, and the number of access requests that have not beenresponded to.

When the service volume sent by the distributed node to the central nodeis the back-to-source volume, the service volume in the preset timeperiod includes one or more of the traffic generated by the distributednode in the preset time period (back-to-source traffic), and the averagebandwidth (back-to-source bandwidth) in the preset time period or thenumber of connections established in the preset time period. Theback-to-source traffic generated by the distributed node in the presettime period may be the amount of content obtained by the distributednode in the preset time period during the back-to-source process. Whenthe service volume is represented by the number of connections, theservice volume in the preset time period is the number of connectionsestablished by the distributed node with the source station within thepreset time period.

Step 202: The central node determines a decision quota of thedistributed node based on the received service volume, and sends thedecision quota to the distributed node.

Each distributed node periodically sends the latest service volume tothe central node. The central node calculates a traffic proportion ofeach distributed node according to the latest service volume, and thencalculates a decision quota corresponding to each distributed nodeaccording to the traffic proportion of each distributed node. The largerthe traffic proportion is, the higher the corresponding decision quotais, that is, more service access requests are allowed to be received. Inthis way, the decision quota of the distributed node can be adjusted inreal time according to the real-time service volume of the distributednode, and according to the decision quota, it is determined whethertraffic limitation needs to be performed, thereby ensuring the accuracyof traffic limitation, and improving the service performance of theentire distributed system.

An expression of the decision quota corresponding to the distributednode is:

ECLi=(LT−(EC1+EC2+ . . . +ECn))*ECPi, i=1,2 . . . n,

where ECLi represents the decision quota corresponding to the i-thdistributed node, LT represents an overall upper limit, ECi representsthe service volume corresponding to the i-th distributed node, ECPirepresents the traffic proportion of the i-th distributed node, andECPi=ECi (EC1+EC2+ . . . +ECn).

The overall upper limit is a value pre-stored in the central node,indicating total load allowed by the distributed system. In a specificembodiment, the overall upper limit may be an overall upper limit of theservice volume generated for serving the access request or an overallupper limit for the back-to-source volume. When traffic limitation isperformed for the scenario of serving the access request, the overallupper limit may be an overall upper limit of the service volumegenerated for serving the access request. When traffic limitation isperformed for the back-to-source scenario, the overall upper limit is anoverall upper limit for the back-to-source volume.

The overall upper limit is expressed in the same manner as the servicevolume reported by the distributed node to the central node. That is, ifthe service volume is expressed by traffic, the overall upper limit isalso expressed by traffic; if the service volume is expressed bybandwidth, the overall upper limit is also expressed by bandwidth; ifthe service volume is expressed by the number of connections, theoverall upper limit is also expressed by the number of connections; ifthe service volume is expressed by the number of access requests, theoverall upper limit is also expressed by the number of access requests.

Step 203: The distributed node receives the decision quota sent by thecentral node.

Step 204: After receiving an access request, the distributed nodedetermines whether traffic limitation needs to be performed for theaccess request.

When traffic limitation is performed for the scenario of serving theaccess request, the distributed node, each time receiving an accessrequest, determines whether needs to be performed for the accessrequest. When traffic limitation is performed for the back-to-sourcescenario, the distributed node, after receiving the access request,determines whether a back-to-source request needs to be sent to thesource station; and if yes, determines, based on the latest receiveddecision quota, whether traffic limitation needs to be performed for theaccess request. A specific process for the distributed node todetermine, based on the latest received decision quota, whether trafficlimitation needs to be performed for the access request is as follows:after receiving the access request, the distributed node compares acurrent service increment with the latest received decision quota,wherein the service increment is a difference between the service volumein the current preset time period and the service volume sent to thecentral node last time; and if the current service increment of thedistributed node is less than the latest received decision quota, skipsperforming traffic limitation, or otherwise, performs traffic limitationfor the access request.

In another embodiment, after determining that the current serviceincrement is greater than or equal to the latest received decisionquota, the distributed node determines a time interval between a currenttime and a time at which a service volume is sent to the central nodelast time; if the time interval is less than a preset duration, performstraffic limitation for the access request; and if the time interval isgreater than or equal to the preset duration, sends the service volumein the current preset time period to the central node, receives a newdecision quota sent by the central node, and then determines, based onthe latest received decision quota, whether traffic limitation is neededto be performed for the access request.

The preset duration is shorter than the fixed period according to whichthe distributed node periodically reports the service volume to thecentral node. For example, the fixed period according to which thedistributed node periodically reports the service volume to the centralnode is 1 minute, and the preset duration may be set to 30 s. After thedistributed node receives the decision quota, the accuracy of thedecision quota may decrease with time. Therefore, when a long time haselapsed after the decision quota is received, that is, when the timeinterval between the current time and the time at which the servicevolume is sent to the central node last time exceeds the presetduration, it indicates that a new decision quota needs to be obtained,in order to avoid the case that traffic limitation is incorrectlyperformed and affects the service quality because the decision quota isnot updated in time.

In a specific embodiment, even if the time at which the service volumeis to be reported to the central node is not reached, the central noderecalculates the decision quota upon receiving a service volume sent bya distributed node, and delivers the new decision quota to thedistributed node.

The following describes the method of limiting traffic of thedistributed node by using the traffic limitation in the scenario ofserving the access request as an example.

Assuming that the fixed period according to which the distributed nodereports the service volume to the central node is 1 minute and thepreset time period for collecting statistics on the service volume is 2minutes, a traffic limitation response process is as follows:

(1) The distributed node sends a service volume ECi1 in the time periodfrom t1-2 to t1 to the central node at time t1.

(2) The distributed node receives a decision quota ECLi1 sent by thecentral node.

(3) The distributed node receives an access request a at the time t2,calculates a current service increment Di1, and if the service incrementDi1 is less than the decision quota ECLi 1, skips performing trafficlimitation, wherein Di1 is obtained by subtracting ECi1 from a servicevolume ECi2 obtained in a time period from t2-2 to t2.

(4) The distributed node receives a next access request b at time t3,calculates a current service increment Di2, and if the service incrementDi2 is less than the decision quota ECLi1, skips performing trafficlimitation, and the process ends; otherwise, determines a time intervalbetween the current time and the time at which the service volume issent to the central node last time, that is, the time interval betweenthe current time and time t1, where Di2 is obtained by subtracting ECi1from a service volume ECi3 in a time period from t3-2 to t3.

(5) If the time interval is greater than the preset duration, send theservice volume ECi3 in the time period of t3-2 to t3 to the centralnode, and go to the next step; otherwise, perform traffic limitation forthe access request b.

(6) The distributed node receives a decision quota ECLi3 sent by thecentral node.

(7) The distributed node compares the service increment Di2 with thedecision quota ECLi3, and if the service increment Di2 is less than thedecision quota ECLi3, skips performing traffic limitation, or otherwise,performs traffic limitation for the access request b.

When traffic limitation is performed for the back-to-source scenario,the traffic limitation may be performed by rejecting the access request,that is, no back-to-source request is sent to the source station. Whenthe traffic limitation is performed for the scenario of serving theaccess request, the traffic limitation may be performed by rejecting theaccess request and/or limiting a response rate to the access request. Aprocess of performing traffic limitation by rejecting the access requestand limiting the response rate to the access request is as follows:

receiving, by the distributed node, a current access request, and afterdetermining that the current service increment is greater than or equalto the latest received decision quota, responding to the access requestwith a preset response rate; and

receiving, by the distributed node, a next access request; if thecurrent service increment is still greater than or equal to the latestreceived decision quota, rejecting the next access request; if thecurrent service increment is less than the latest received decisionquota and a current average response rate is greater than the presetresponse rate, responding to the next access request at the presetresponse rate, wherein the current average response rate is equal to aratio of traffic generated in the current preset time period to thenumber of access requests in the current preset time period; and if thecurrent service increment is less than the latest received decisionquota and the current average response rate is less than or equal to thepreset response rate, skipping performing traffic limitation.

When no traffic limitation needs to be performed for the access request,the access request is processed at a default response rate. The presetresponse rate is less than the default response rate.

As shown in FIG. 3, a backup central node may further be disposed. Thecentral node periodically synchronizes data to the backup central node.When the central node is faulty, the backup central node replaces thecentral node to provide services. Specifically, the central node and thebackup central node are connected to a same access layer, and the accesslayer is connected to each of the distributed nodes. The access layer isconfigured to receive data sent by each of the distributed nodes, andguide the data to the central node or the backup central node. When thecentral node works normally, the access layer guides the received datato the central node. When the central node is faulty, the access layerguides the received data to the backup central node, thereby ensuringthat the traffic limitation decision is normally made, and ensuring theservice performance of the distributed system.

In this embodiment of the present application, the traffic limitationdecision is made by the distributed node autonomously, the decision pathis short, and fast decision is achieved. In addition, according to thestatistical principle, a corresponding decision quota can be allocatedeach distributed node according to the real-time service volume of eachdistributed node. That is, the larger the service volume is, the higherthe allocated decision quota is. In this way, a distributed node in aheavy-traffic area can receive and respond to access requests to thegreatest extent, thereby improving the utilization of resources.Moreover, the method of limiting traffic is more accurate and canimprove the service performance of the distributed system.

An embodiment of the present disclosure further provides a system oflimiting traffic, including a distributed node and a central node,wherein

the distributed node is configured to send a service volume in a currentpreset time period to the central node according to a fixed period;

the central node is configured to determine a decision quota of thedistributed node based on the received service volume, and send thedecision quota to the distributed node; and

the distributed node is configured to receive the decision quota sent bythe central node, and after receiving an access request, determine,based on the latest received decision quota, whether traffic limitationneeds to be performed for the access request.

For example, the service volume further includes a back-to-sourcevolume; and

correspondingly, the distributed node is configured to:

after receiving an access request, determine whether a back-to-sourcerequest needs to be sent to a source station; and

if yes, determine, based on the latest received decision quota, whethertraffic limitation needs to be performed for the access request.

For example, the service volume in the preset time period includes oneor more of traffic generated by the distributed node in the preset timeperiod, an average bandwidth in the preset time period, the number ofconnections established in the preset time period, or the number ofaccess requests in the preset time period.

For example, the distributed node is configured to:

compare a current service increment with the latest received decisionquota; and

if the current service increment is less than the latest receiveddecision quota, skip performing traffic limitation, or otherwise,perform traffic limitation for the access request.

For example, the distributed node is configured to:

determine a time interval between a current time and a time at which aservice volume is sent to the central node last time;

if the time interval is less than a preset duration, performing trafficlimitation for the access request; and

if the time interval is greater than or equal to the preset duration,send the service volume in the current preset time period to the centralnode, receive a new decision quota sent by the central node, and thendetermine, based on the latest received decision quota, whether trafficlimitation needs to be performed for the access request.

For example, the distributed node is configured to:

perform traffic limitation by rejecting the access request; or performtraffic limitation by limiting a response rate to the access request.

For example, the distributed node is configured to:

after determining that the current service increment is greater than orequal to the latest received decision quota, respond to the accessrequest with a preset response rate; and

receive a next access request, and reject the next access request if thecurrent service increment is still greater than or equal to the latestreceived decision quota.

For example, the distributed node is configured to:

receive the next access request after responding to the access requestat the preset response rate, and if the current service increment isless than the latest received decision quota and a current averageresponse rate is greater than the preset response rate, respond to thenext access request at the preset response rate; wherein the currentaverage response rate is equal to a ratio of traffic generated in thecurrent preset time period to the number of access requests in thecurrent preset time period; and

receive the next access request, and if the current service increment isless than the latest received decision quota and the current averageresponse rate is less than or equal to the preset response rate, skipperforming traffic limitation.

In this embodiment of the present disclosure, the traffic limitationdecision is made by the distributed node autonomously, the decision pathis short, and fast decision is achieved. In addition, according to thestatistical principle, a corresponding decision quota can be allocatedeach distributed node according to the real-time service volume of eachdistributed node. That is, the larger the service volume is, the higherthe allocated decision quota is. In this way, a distributed node in aheavy-traffic area can receive and respond to access requests to thegreatest extent, thereby improving the utilization of resources.Moreover, the method of limiting traffic is more accurate and canimprove the service performance of the distributed system.

It should be noted that, the system of limiting traffic provided by thisembodiment and the embodiment of the method of limiting traffic belongto the same concept. A specific implementation process of the system oflimiting traffic may refer to the method embodiments for details, anddetails are not described herein again.

FIG. 3 is a schematic structural diagram of a node device according toan embodiment of the present disclosure. The node device 400 may varygreatly due to different configurations or performance, and may includeone or more central processing units (CPU) 422 (for example, one or moreprocessors) and memories 432, and one or more storage media 430 (forexample, one or more mass storage devices) storing an applicationprogram 442 or data 444. The memory 432 and the storage medium 430 maybe temporary or permanent storages. The program stored in the storagemedium 430 may include one or more modules (not shown), and each modulemay include a series of instructions and operations for the node device.Further, the central processing unit 422 may be configured tocommunicate with the storage medium 430, and execute, on the node device400, a series of instructions and operations in the storage medium 430.

The node device 400 may further include one or more power supplies 424,one or more wired or wireless network interfaces 450, one or moreinput/output interfaces 458, one or more keyboards 454, and/or one ormore operating systems 441, for example, Windows Server, Mac OS X,Unix™, Linux, or FreeBSD.

The node device 400 may include a memory and at least one program,wherein the at least one program is stored in the memory, and isconfigured, to cause the at least one processor execute the at least oneprogram, including instructions for performing the method of limitingtraffic:

sending a service volume in a current preset time period to a centralnode according to a fixed period;

receiving a decision quota sent by the central node;

determining, based on the latest received decision quota after receivingan access request, whether traffic limitation needs to be performed forthe access request.

A person of ordinary skill in the art may understand that all or some ofthe steps of the embodiments may be implemented by hardware or a programinstructing related hardware. The program may be stored in acomputer-readable storage medium. The storage medium may include: aread-only memory, a magnetic disk, or an optical disc.

The foregoing descriptions are merely preferred embodiments of thepresent disclosure, but are not intended to limit the presentdisclosure. Any modification, equivalent replacement, or improvementmade within the spirit and principle of the present disclosure shallfall within the protection scope of the present disclosure.

What is claimed is:
 1. A method of limiting traffic, comprising:sending, by a distributed node, a service volume in a current presettime period to a central node according to a fixed period; determining,by the central node, a decision quota of the distributed node based onthe received service volume, and sending the decision quota to thedistributed node; receiving, by the distributed node, the decision quotasent by the central node; and determining, by the distributed node basedon the latest received decision quota after receiving an access request,whether traffic limitation needs to be performed for the access request.2. The method according to claim 1, wherein the service volume furthercomprises a back-to-source volume; and correspondingly, the step ofdetermining, by the distributed node based on the latest receiveddecision quota after receiving the access request, whether trafficlimitation needs to be performed for the access request comprises: afterreceiving the access request, determining, by the distributed node,whether a back-to-source request needs to be sent to a source station;and if yes, determining, based on the latest received decision quota,whether traffic limitation needs to be performed for the access request.3. The method according to claim 2, wherein the service volume in thepreset time period comprises at least one of traffic generated by thedistributed node in the preset time period, an average bandwidth in thepreset time period, the number of connections established in the presettime period, and the number of access requests in the preset timeperiod.
 4. The method according to claim 1, wherein the service volumein the preset time period comprises at least one of traffic generated bythe distributed node in the preset time period, an average bandwidth inthe preset time period, the number of connections established in thepreset time period, and the number of access requests in the preset timeperiod.
 5. The method according to claim 1, wherein the step ofdetermining, by the distributed node based on the latest receiveddecision quota, whether traffic limitation needs to be performed for theaccess request comprises: comparing, by the distributed node, a currentservice increment with the latest received decision quota; and if thecurrent service increment of the distributed node is less than thelatest received decision quota, skipping performing traffic limitation,or otherwise, performing traffic limitation for the access request. 6.The method according to claim 5, wherein after the determining, by thedistributed node, that the current service increment is greater than orequal to the latest received decision quota, the method furthercomprises: determining a time interval between a current time and a timeat which a service volume is sent to the central node last time; if thetime interval is less than a preset duration, performing trafficlimitation for the access request; and if the time interval is greaterthan or equal to the preset duration, sending the service volume in thecurrent preset time period to the central node, receiving a new decisionquota sent by the central node, and then determining, based on thelatest received decision quota, whether traffic limitation needs to beperformed for the access request.
 7. The method according to claim 6,wherein the step of performing, by the distributed node, trafficlimitation for the access request comprises: rejecting, by thedistributed node, the access request; or limiting, by the distributednode, a response rate to the access request.
 8. The method according toclaim 5, wherein the step of performing, by the distributed node,traffic limitation for the access request comprises: rejecting, by thedistributed node, the access request; or limiting, by the distributednode, a response rate to the access request.
 9. The method according toclaim 5, wherein after the determining, by the distributed node, thatthe current service increment is greater than or equal to the latestreceived decision quota, the method further comprises: responding, bythe distributed node, to the access request with a preset response rate;and receiving, by the distributed node, a next access request, andrejecting the next access request if the current service increment isstill greater than or equal to the latest received decision quota. 10.The method according to claim 9, wherein after the responding, by thedistributed node, to the access request with a preset response rate, themethod further comprises: receiving, by the distributed node, the nextaccess request, and if the current service increment is less than thelatest received decision quota and a current average response rate isgreater than the preset response rate, responding to the next accessrequest at the preset response rate, wherein the current averageresponse rate is equal to a ratio of traffic generated in the currentpreset time period to the number of access requests in the currentpreset time period; and receiving, by the distributed node, the nextaccess request, and if the current service increment is less than thelatest received decision quota, and the current average response rate isless than or equal to the preset response rate, skipping performingtraffic limitation.
 11. A system of limiting traffic, comprising adistributed node and a central node, wherein the distributed node isconfigured to send a service volume in a current preset time period tothe central node according to a fixed period; the central node isconfigured to determine a decision quota of the distributed node basedon the received service volume, and send the decision quota to thedistributed node; and the distributed node is configured to receive thedecision quota sent by the central node, and after receiving an accessrequest, determine, based on the latest received decision quota, whethertraffic limitation needs to be performed for the access request.
 12. Thesystem according to claim 11, wherein the service volume in the presettime period comprises at least one of traffic generated by thedistributed node in the preset time period, an average bandwidth in thepreset time period, the number of connections established in the presettime period, the number of access requests in the preset time period.13. A node device, comprising: at least one processor; and a memorycommunicably connected with the at least one processor for storinginstructions executable by the at least one processor, wherein executionof the instructions by the at least one processor causes the at leastone processor to perform the processing process performed by thedistributed node in a method of limiting traffic, comprising: sending,by a distributed node, a service volume in a current preset time periodto a central node according to a fixed period; determining, by thecentral node, a decision quota of the distributed node based on thereceived service volume, and sending the decision quota to thedistributed node; receiving, by the distributed node, the decision quotasent by the central node; determining, by the distributed node based onthe latest received decision quota after receiving an access request,whether traffic limitation needs to be performed for the access request.14. The node device according to claim 13, wherein the service volumefurther comprises a back-to-source volume; and correspondingly, the stepof determining, by the distributed node based on the latest receiveddecision quota after receiving the access request, whether trafficlimitation needs to be performed for the access request comprises: afterreceiving the access request, determining, by the distributed node,whether a back-to-source request needs to be sent to a source station;and if yes, determining, based on the latest received decision quota,whether traffic limitation needs to be performed for the access request.15. The node device according to claim 13, wherein the service volume inthe preset time period comprises at least one of traffic generated bythe distributed node in the preset time period, an average bandwidth inthe preset time period, the number of connections established in thepreset time period, and the number of access requests in the preset timeperiod.
 16. The node device according to claim 13, wherein the step ofdetermining, by the distributed node based on the latest receiveddecision quota, whether traffic limitation needs to be performed for theaccess request comprises: comparing, by the distributed node, a currentservice increment with the latest received decision quota; and if thecurrent service increment of the distributed node is less than thelatest received decision quota, skipping performing traffic limitation,or otherwise, performing traffic limitation for the access request. 17.The node device according to claim 16, wherein after the determining, bythe distributed node, that the current service increment is greater thanor equal to the latest received decision quota, the method furthercomprises: determining a time interval between a current time and a timeat which a service volume is sent to the central node last time; if thetime interval is less than a preset duration, performing trafficlimitation for the access request; and if the time interval is greaterthan or equal to the preset duration, sending the service volume in thecurrent preset time period to the central node, receiving a new decisionquota sent by the central node, and then determining, based on thelatest received decision quota, whether traffic limitation needs to beperformed for the access request.
 18. The node device according to claim16, wherein the step of performing, by the distributed node, trafficlimitation for the access request comprises: rejecting, by thedistributed node, the access request; or limiting, by the distributednode, a response rate to the access request.
 19. The node deviceaccording to claim 16, wherein after the determining, by the distributednode, that the current service increment is greater than or equal to thelatest received decision quota, the method further comprises:responding, by the distributed node, to the access request with a presetresponse rate; and receiving, by the distributed node, a next accessrequest, and rejecting the next access request if the current serviceincrement is still greater than or equal to the latest received decisionquota.
 20. The node device according to claim 19, wherein after theresponding, by the distributed node, to the access request with a presetresponse rate, the method further comprises: receiving, by thedistributed node, the next access request, and if the current serviceincrement is less than the latest received decision quota and a currentaverage response rate is greater than the preset response rate,responding to the next access request at the preset response rate,wherein the current average response rate is equal to a ratio of trafficgenerated in the current preset time period to the number of accessrequests in the current preset time period; and receiving, by thedistributed node, the next access request, and if the current serviceincrement is less than the latest received decision quota and thecurrent average response rate is less than or equal to the presetresponse rate, skipping performing traffic limitation.